package com.football.service;

import okhttp3.*;
import top.hserver.core.ioc.annotation.Autowired;
import top.hserver.core.ioc.annotation.Bean;

import java.io.IOException;

@Bean
public class VideoService {

  @Autowired
  private OkHttpClient client;

  private final String url = "http://api.zhangyudi.com/v2/news/channelPage";

  public String post(FormBody formBody) throws IOException {
    Request request = new Request.Builder()
      .url(url)
      .post(formBody)
      .build();
    Response response = client.newCall(request).execute();
    return response.body().string();
  }
}